decimal to hexadecimal in python with function